$.ajax({
    url:"http://localhost:8888/pharmacy/domestic",
    type:"POST",
    dataType:"json",
    //data->解析之后的json数据
    success:function (data) {
        if(data.msg=="success"){
            var updateTime = data.newslist[0].desc.modifyTime;
            var updateTime = (new Date(data.newslist[0].desc.modifyTime)).Format('yyyy.MM.dd HH:mm');
            // var updateTime =  ${tzhang:dateFormat1(updateTime,"yyyy.MM.dd HH:mm")}

                $('#Domestic-overview').text("");
                $('#Domestic-overview').append(
                      `
                            <div class="VirusSummarySix_1-1-264_ZRHUKw">
                                <div class="Virus_1-1-264_2dO8Hx">
                                    <div class="Virus_1-1-264_3U87rg">国内疫情</div>
                                    <div class="Virus_1-1-264_32Y_aO"><span>数据更新至&nbsp;&nbsp;&nbsp;${updateTime}</span></div>
                                </div>
                                <div class="VirusSummarySix_1-1-264_3U50rt">
                                    <div class="VirusSummarySix_1-1-264_3wCKWi VirusSummarySix_1-1-264_123ZxM">
                                        <div  class="VirusSummarySix_1-1-264_31c2vJ">
                                            <span style="position: relative;">现有确诊</span>
                                        </div>
                                        <div class="VirusSummarySix_1-1-264_3haLBF VirusSummarySix_1-1-264_2ZJJBJ">${data.newslist[0].desc.currentConfirmedCount}</div>
                                    </div>
                                    <div class="VirusSummarySix_1-1-264_3wCKWi VirusSummarySix_1-1-264_l6KpVT">
                                        <div class="VirusSummarySix_1-1-264_31c2vJ">
                                            <span class="VirusSummarySix_1-1-264_31c2vJ" style="position: relative;">无症状</span>
                                        </div>
                                        <div class="VirusSummarySix_1-1-264_3haLBF VirusSummarySix_1-1-264_2ZJJBJ">${data.newslist[0].desc.seriousCount}</div>
                                    </div>
                                    <div class="VirusSummarySix_1-1-264_3wCKWi VirusSummarySix_1-1-264_JfPOST">
                                        <div class="VirusSummarySix_1-1-264_31c2vJ">境外输入</div>
                                        <div class="VirusSummarySix_1-1-264_3haLBF VirusSummarySix_1-1-264_2ZJJBJ">${data.newslist[0].desc.suspectedCount}</div>
                                    </div>
                                </div>
                                <div class="VirusSummarySix_1-1-264_3U50rt VirusSummarySix_1-1-264_1KtzV-">
                                    <div class="VirusSummarySix_1-1-264_3wCKWi VirusSummarySix_1-1-264_c39Mfc">
                                        <div class="VirusSummarySix_1-1-264_31c2vJ">累计确诊</div>
                                        <div class="VirusSummarySix_1-1-264_3haLBF VirusSummarySix_1-1-264_2ZJJBJ">${data.newslist[0].desc.confirmedCount}</div>
                                    </div>
                                    <div class="VirusSummarySix_1-1-264_3wCKWi VirusSummarySix_1-1-264_UYd2fc">
                                        <div class="VirusSummarySix_1-1-264_31c2vJ">累计治愈</div>
                                        <div class="VirusSummarySix_1-1-264_3haLBF VirusSummarySix_1-1-264_2ZJJBJ">${data.newslist[0].desc.curedCount}</div>
                                    </div>
                                    <div class="VirusSummarySix_1-1-264_3wCKWi VirusSummarySix_1-1-264_27xUAr">
                                        <div class="VirusSummarySix_1-1-264_31c2vJ">累计死亡</div>
                                        <div class="VirusSummarySix_1-1-264_3haLBF VirusSummarySix_1-1-264_2ZJJBJ">${data.newslist[0].desc.deadCount}</div>
                                    </div>
                                </div>
                            </div>
                       `
            )


            $('#OverseasEpidemic').text("");
            $('#OverseasEpidemic').append(
                `
                    <div id="ptab-4" style="margin-top: 2.5rem;">
                        <div class="Virus_1-1-264_3U87rg">国外疫情</div>
                        <div class="Main_1-1-264_1kqITh">
                            <div class="Tip_1-1-264_16-DfN"><span class="Tip_1-1-264_aNRVa5">数据更新至&nbsp;&nbsp;&nbsp;${updateTime}</span></div>
                        </div>
                    </div>
                    <div class="VirusSummary_1-1-264_popavK"
                         style="background: rgb(255, 255, 255); margin-top: 0.6875rem;">
                        <table class="VirusSummary_1-1-264_26c8Iu VirusSummary_1-1-264_2fRxdu">
                            <tbody>
                            <tr>
                                <td>
                                    <div class="VirusSummary_1-1-264_6xUfqo">
                                        <div class="VirusSummary_1-1-264_Af8Lb3">现有确诊</div>
                                        <div class="VirusSummary_1-1-264_1lOkwH VirusSummary_1-1-264_2fhqEt">${data.newslist[0].desc.foreignStatistics.currentConfirmedCount}</div>
                                    </div>
                                </td>
                                <td>
                                    <div class="VirusSummary_1-1-264_1erbWM">
                                        <div class="VirusSummary_1-1-264_Af8Lb3">累计确诊</div>
                                        <div class="VirusSummary_1-1-264_1lOkwH VirusSummary_1-1-264_2fhqEt">${data.newslist[0].desc.foreignStatistics.confirmedCount}</div>
                                    </div>
                                </td>
                                <td>
                                    <div class="VirusSummary_1-1-264_2ahJaj">
                                        <div class="VirusSummary_1-1-264_Af8Lb3">累计治愈</div>
                                        <div class="VirusSummary_1-1-264_1lOkwH VirusSummary_1-1-264_2fhqEt">${data.newslist[0].desc.foreignStatistics.curedCount}</div>
                                    </div>
                                </td>
                                <td>
                                    <div class="VirusSummary_1-1-264_28rIkx">
                                        <div class="VirusSummary_1-1-264_Af8Lb3">累计死亡</div>
                                        <div class="VirusSummary_1-1-264_1lOkwH VirusSummary_1-1-264_2fhqEt">${data.newslist[0].desc.foreignStatistics.deadCount}</div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                `
            )
        }
    },
})




$.ajax({
    url:"http://localhost:8888/pharmacy/external",
    tyle:"POST",
    dataType:"json",
    //data->解析之后的json数据
    success:function (data) {
        if(data.msg=="success"){
            console.log(data.newslist)
            console.log(data.newslist.length)
            $('#external').text("");
            for(var i = 0;i < data.newslist.length ;i++){
                    $('#external').append(
                    `
                        <tr class="VirusTable_1-1-264_3m6Ybq">
                            <td class="VirusTable_1-1-264_MdE8uT">
                                <div class="VirusTable_1-1-264_AcDK7v">
                                    <span class="VirusTable_1-1-264_2NQDw6 VirusTable_1-1-264_3Injfc"></span><span>${data.newslist[i].provinceName}</span>
                                </div>
                            </td>
                            <td class="VirusTable_1-1-264_3x1sDV">${data.newslist[i].currentConfirmedCount}</td>
                            <td class="VirusTable_1-1-264_3x1sDV">${data.newslist[i].confirmedCount}</td>
                            <td class="VirusTable_1-1-264_EjGi8c">${data.newslist[i].curedCount}</td>
                            <td class="VirusTable_1-1-264_EjGi8c">${data.newslist[i].deadCount}</td>
                        </tr>
                    `
                )
            }
        }
    },
})


$.ajax({
    url:"http://localhost:8888/pharmacy/province",
    tyle:"POST",
    dataType:"json",
    //data->解析之后的json数据
    success:function (data) {
        if(data.msg=="success"){
            console.log(data.newslist)
            console.log(data.newslist.length)
            $('#province').text("");
            for(var i = 0;i < data.newslist.length ;i++){
                $('#province').append(
                    `
                        <tr class="VirusTable_1-1-264_3m6Ybq">
                            <td class="VirusTable_1-1-264_MdE8uT">
                                <div class="VirusTable_1-1-264_AcDK7v">
                                    <span class="VirusTable_1-1-264_2NQDw6 VirusTable_1-1-264_3Injfc"></span><span>${data.newslist[i].provinceShortName}</span>
                                </div>
                            </td>
                            <td class="VirusTable_1-1-264_3x1sDV">${data.newslist[i].currentConfirmedCount}</td>
                            <td class="VirusTable_1-1-264_3x1sDV">${data.newslist[i].confirmedCount}</td>
                            <td class="VirusTable_1-1-264_EjGi8c">${data.newslist[i].curedCount}</td>
                            <td class="VirusTable_1-1-264_EjGi8c">${data.newslist[i].deadCount}</td>
                        </tr>
                    `
                )
            }
        }
    },
})



Date.prototype.Format = function (fmt) { //author: meizz
    var o = {
        "M+": this.getMonth() + 1, //月份
        "d+": this.getDate(), //日
        "H+": this.getHours(), //小时
        "m+": this.getMinutes(), //分
        "s+": this.getSeconds(), //秒
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
        "S": this.getMilliseconds() //毫秒
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}